** Vreeland_IO08

use Vreeland_2008_IO.dta , clear

rename imf_code imfcode	
sort imfcode year
merge m:1 imfcode using gattlist.dta 
drop if _m==2 
drop _merge
sort imfcode year
merge m:1 imfcode using wtolist.dta 
drop if _m==2 
drop _merge

gen gatt = year>=gattjoin
gen wto = year>=wtojoin
gen gattwto = gatt==1 | wto==1

gen study = ""
foreach n in orig noth fe time fet ct yfe cyfe {
gen method_`n' = ""
gen dv_`n' = ""
gen b_gatt_`n' = .
gen se_gatt_`n'= .
gen pval_gatt_`n' = .
gen lo_gatt_`n'=.
gen hi_gatt_`n'=.
gen N_gatt_`n'=.
}
gen studynum=.
gen timetrend=""
qui do gatt.do

local ii = 1
 *** Table 1: Political parties under dictatorship and levels of torture -- Hathaway torture data
*Ordinal logit
* model 1
ologit torture gattwto party level g population tradegdp war communist if reg==1, robust
gatt `ii' orig
ologit torture gattwto party level g population tradegdp war communist if reg==1, robust
gatt `ii' noth
ologit torture gattwto party level g population tradegdp war communist year if reg==1, robust
gatt `ii' time

replace studynum = `ii' if _n==`ii'   
local ii=`ii'+1
*Fixed effects logit
* model 2
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(aclpcode) 
gatt `ii' orig
logit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, 
gatt `ii' noth
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(aclpcode) 
gatt `ii' fe
logit common_tort_hath gattwto party level g population tradegdp war communist year if reg==1, cl(aclpcode) 
gatt `ii' time
clogit common_tort_hath gattwto party level g population tradegdp war communist year if reg==1, group(aclpcode) 
gatt `ii' fet
logit common_tort_hath gattwto party level g population tradegdp war communist i.aclpcode#c.year if reg==1, cl(aclpcode) 
gatt `ii' ct
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(year) 
gatt `ii' yfe
xtreg common_tort_hath gattwto party level g population tradegdp war communist i.year if reg==1, i(aclpcode) 
gatt `ii' cyfe

replace studynum = `ii' if _n==`ii'   
local ii=`ii'+1
*Duration dependence logit
* model 3
btscs common_tort_hath   year aclpcode, generate (hath_spline) nspline (3)
logit common_tort_hath gattwto party level g population tradegdp war communist hath_spline _spline1 _spline2 _spline3 if reg==1, robust
gatt `ii' orig
logit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, robust
gatt `ii' noth
logit common_tort_hath gattwto party level g population tradegdp war communist hath_spline _spline1 _spline2 _spline3 if reg==1, robust
gatt `ii' time
clogit common_tort_hath gattwto party level g population tradegdp war communist hath_spline _spline1 _spline2 _spline3 if reg==1, group(aclpcode)
gatt `ii' fet
logit common_tort_hath gattwto party level g population tradegdp war communist i.aclpcode#c.year hath_spline _spline1 _spline2 _spline3 if reg==1, robust
gatt `ii' ct
xtreg common_tort_hath gattwto party level g population tradegdp war communist hath_spline _spline1 _spline2 _spline3 i.year if reg==1, i(aclpcode)
gatt `ii' cyfe
replace studynum = `ii' if _n==`ii'   
replace timetrend="splines" if _n==`ii'
local ii=`ii'+1

* model 4
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(aclpcode) robust
gatt `ii' orig
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(aclpcode) robust
gatt `ii' fe
logit common_tort_hath gattwto party level g population tradegdp war communist year if reg==1, cl(aclpcode) robust
gatt `ii' time 
clogit common_tort_hath gattwto party level g population tradegdp war communist year if reg==1, group(aclpcode) robust
gatt `ii' fet
logit common_tort_hath gattwto party level g population tradegdp war communist i.aclpcode#c.year if reg==1, cl(aclpcode) robust
gatt `ii' ct 
clogit common_tort_hath gattwto party level g population tradegdp war communist if reg==1, group(year) robust
gatt `ii' yfe
xtreg common_tort_hath gattwto party level g population tradegdp war communist i.year if reg==1, i(aclpcode) robust
gatt `ii' cyfe
replace studynum = `ii' if _n==`ii'   
local ii=`ii'+1
* model 5
clogit common_tort_hath gattwto party population communist if reg==1, group(aclpcode) robust
gatt `ii' orig
logit common_tort_hath gattwto party population communist if reg==1,  robust
gatt `ii' noth
clogit common_tort_hath gattwto party population communist if reg==1, group(aclpcode) robust
gatt `ii' fe
logit common_tort_hath gattwto party population communist year if reg==1, cl(aclpcode) robust
gatt `ii' time
clogit common_tort_hath gattwto party population communist year if reg==1, group(aclpcode) robust
gatt `ii' fet
logit common_tort_hath gattwto party population communist i.aclpcode#c.year if reg==1, cl(aclpcode) robust
gatt `ii' ct
clogit common_tort_hath gattwto party population communist if reg==1, group(year) robust
gatt `ii' yfe
xtreg common_tort_hath gattwto party population communist i.year if reg==1, i(aclpcode) robust
gatt `ii' cyfe
replace studynum = `ii' if _n==`ii'   
local ii=`ii'+1
replace study = "Vreeland" if studynum~=. 	

keep study-timetrend
drop if studynum==.
compress
save vreeland.dta , replace

